import { Models } from "../../../common/typings/model";
import KoaRouter from 'koa-router'
import Mysql from "../../../core/Mysql";
import Result from "../../../common/utils/Result";
const router = new KoaRouter({
    prefix:'/api/v1/user'
})

router.get('/login',async (ctx: Models.Ctx,next:Function)=> {
    
    const sql = `SELECT
                *
                FROM
                poetry as p
                WHERE
                p.title LIKE '%李%'
                LIMIT 1,
                10`
    const res = await Mysql.query(sql)
    console.log(res)
    const {
        userName
    } = ctx.query
    ctx.body = Result.success({
        results: res
    })
})

export default router